using System;
using System.Collections.Generic;
using System.Data.Linq;
using System.Data.Linq.Mapping;
using System.Linq;
using System.Text;
using WebExam.Core.Repository;

namespace WebExam.DataEntities
{

    [Table(Name = "dbo.YX")]
    public partial class YX :Entity
    {

        private decimal _yxNum;

        private string _yxName;

        private bool _yxZF;

        private EntitySet<ZY> _ZY;

        public YX()
        {
            this._ZY = new EntitySet<ZY>(new Action<ZY>(this.attach_ZY), new Action<ZY>(this.detach_ZY));
        }

        [Column(Storage = "_yxNum", AutoSync = AutoSync.OnInsert, DbType = "Decimal(18,0) NOT NULL IDENTITY", IsPrimaryKey = true, IsDbGenerated = true)]
        public decimal YXNum
        {
            get
            {
                return this._yxNum;
            }
            set
            {
                if ((this._yxNum != value))
                {
                    this.SendPropertyChanging("YXNum");
                    this._yxNum = value;
                    this.SendPropertyChanged("YXNum",value);
                }
            }
        }

        [Column(Storage = "_yxName", DbType = "VarChar(20) NOT NULL", CanBeNull = false)]
        public string YXName
        {
            get
            {
                return this._yxName;
            }
            set
            {
                if ((this._yxName != value))
                {
                    this.SendPropertyChanging("YXName");
                    this._yxName = value;
                    this.SendPropertyChanged("YXName",value);
                }
            }
        }

        [Column(Storage = "_yxZF", DbType = "Bit NOT NULL")]
        public bool YXZF
        {
            get
            {
                return this._yxZF;
            }
            set
            {
                if ((this._yxZF != value))
                {
                    this.SendPropertyChanging("YXZF");
                    this._yxZF = value;
                    this.SendPropertyChanged("YXZF",value);
                }
            }
        }

        [Association(Name = "YX_ZY", Storage = "_ZY", ThisKey = "YXNum", OtherKey = "YXNum")]
        public EntitySet<ZY> ZY
        {
            get
            {
                return this._ZY;
            }
            set
            {
                this._ZY.Assign(value);
            }
        }

        private void attach_ZY(ZY entity)
        {
            entity.YX = this;
        }

        private void detach_ZY(ZY entity)
        {
            entity.YX = null;
        }
    }
}
